<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.manager.base.BaseService, com.manager.pojo.system.SysUser,com.manager.util.CONSTANT" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<link href="base/css/base.css" type="text/css" rel="stylesheet">
	<link href="${applicationScope.skin.left}" type="text/css" rel="stylesheet">
	
	<script src="base/jquery/jquery.js" type="text/javascript"></script>
	<script src="base/jquery/jquery-plugin/easing/jquery.easing.js" type="text/javascript"></script>
	
	<script src="base/js/left.js" type="text/javascript"></script>
  </head>
  
  <body id="leftColumn">
  	<div id="menuTitle">操作菜单</div>
  	<!-- example
  		<div class="menuBox">
			<div class="up"><div class="arrow"></div>部门管理</div>
			<ul>
				<li><a href="commonAction!forward.ac?url=system/departmentAdd.jsp" target="mainRight">添加部门</a></li>
				<li class="last"><a href="commonAction!forward.ac?url=system/department.jsp" target="mainRight">搜索部门</a></li>
			</ul>
		</div>
  	 -->
  	<%
  	  		SysUser sysUser = (SysUser)session.getAttribute(CONSTANT.SESSION_KEY);
  	  		int id = sysUser.getId();
  	  		BaseService baseService= (BaseService)CONSTANT.SERVLET_CONTEXT.getAttribute("baseService");
  	  		
  	  		List<Map> list = baseService.callProList("PRO_QUERY_LEFTMENU_PRIVILEGE", sysUser.getId());
  	  		
  	  		if(list != null && list.size() > 0){
		  	  	String str = "";
		  		String menuName = "";
		  		Map m = null;
		  		for(int i = 0; i < list.size(); i++){
		  			m = list.get(i);
		  			menuName = m.get("mname").toString();
		  			if(!menuName.equals(str)){
		  				if(i != 0){
		  			out.print("</ul>");//end ul
		  			out.print("</div><!-- end menuBox -->");//end menuBox
		  				}
		  				
		  				out.print("<div class='menuBox'>");
		  			out.print("<div class='up'><div class='arrow'></div>" + menuName);
		  				out.print("</div>");//end menu
		  				out.print("<ul>");
		  			}
		  			out.print("<li><a href=\"" + m.get("url").toString() + "\" target=\"mainRight\">" + m.get("pname").toString() + "</a></li>");
		  			str = menuName;
		  		}
  	  		}
  	%>
  </body>
</html>
